<?php if (!defined('THINK_PATH')) exit();?><div class="am-container">
    <form class="am-form conf-form" method="post" action="<?php echo U('Data/stageConfHandle');?>">
        <table class="am-table">
            <thead>
            <tr>
                <th>#</th>
                <th>销售阶段</th>
                <th>赢率(%)</th>
                <th>停滞天数</th>
            </tr>
            </thead>
            <tbody>
            <tr id="tr_1">
                <td class="vc">1</td>
                <td><input type="text" class="am-form-field" name="sname1" placeholder="联络客户" /></td>
                <td><input type="text" class="am-form-field am-radius" name="rate1" placeholder="10" /></td>
                <td><input type="text" class="am-form-field am-radius" placeholder="7" /></td>
            </tr>
            <tr id="tr_2">
                <td class="vc">2</td>
                <td><input type="text" class="am-form-field" name="sname2" placeholder="发现机会" /></td>
                <td><input type="text" class="am-form-field am-radius" name="rate2" placeholder="20" /></td>
                <td><input type="text" class="am-form-field am-radius" placeholder="7" /></td>
            </tr>
            <tr id="tr_3">
                <td class="vc">3</td>
                <td><input type="text" class="am-form-field" name="sname3" placeholder="确认机会" /></td>
                <td><input type="text" class="am-form-field am-radius" name="rate3" placeholder="30" /></td>
                <td><input type="text" class="am-form-field am-radius" placeholder="7" /></td>
            </tr>
            <tr id="tr_4">
                <td class="vc">4</td>
                <td><input type="text" class="am-form-field" name="sname4" placeholder="明确需求" /></td>
                <td><input type="text" class="am-form-field am-radius" name="rate4" placeholder="40" /></td>
                <td><input type="text" class="am-form-field am-radius" placeholder="7" /></td>
            </tr>
            <tr id="tr_5">
                <td class="vc">5</td>
                <td><input type="text" class="am-form-field" name="sname5" placeholder="方案报价" /></td>
                <td><input type="text" class="am-form-field am-radius" name="rate5" placeholder="50" /></td>
                <td><input type="text" class="am-form-field am-radius" placeholder="7" /></td>
            </tr>
            <tr id="tr_6">
                <td class="vc">6</td>
                <td><input type="text" class="am-form-field" name="sname6" placeholder="客户承诺" /></td>
                <td><input type="text" class="am-form-field am-radius" name="rate6" placeholder="80" /></td>
                <td><input type="text" class="am-form-field am-radius" placeholder="7" /></td>
            </tr>
            <tr id="tr_7">
                <td class="vc">7</td>
                <td><input type="text" class="am-form-field" name="sname7" placeholder="验收" /></td>
                <td><input type="text" class="am-form-field am-radius" name="rate7" placeholder="90" /></td>
                <td><input type="text" class="am-form-field am-radius" placeholder="7" /></td>
            </tr>
            </tbody>
        </table>

        <div class="am-g am-text-center conf-b">
            <button class="am-margin-xs am-btn am-btn-danger" type="button" onclick="delTr();"><i class="am-icon-minus am-icon-sm"></i></button>
            <button class="am-margin-xs am-btn am-btn-secondary" type="button" onclick="addTr();"><i class="am-icon-plus am-icon-sm"></i></button>
            <button class="am-margin-xs am-btn am-btn-success" type="submit"><i class="am-icon-check am-icon-sm"></i></button>
        </div>
    </form>
</div>
<!-- /.am-container -->

<script type="text/javascript">
    function delTr () {
        $("tbody tr:last-child").remove();
    }
    function addTr () {
        var i = parseInt($("tbody tr:last-child").children(".vc").text())+1;
        var tr = $("tbody tr:last-child").clone(true);
        tr.children(".vc").text(i);
        tr.children(".vc").next().children().attr("name","sname"+i);
        tr.children(".vc").next().next().children().attr("name","rate"+i);
        tr.appendTo("tbody");
    }
</script>